﻿@{
    Layout = null;
}
<html>
<head>
<script>
    //http://tongji.baidu.com
    var _hmt = _hmt || [];
    (function () {
        var hm = document.createElement("script");
        hm.src = "//hm.baidu.com/hm.js?70e21ca061bc9dd5d28dd8a85daca60a";
        var s = document.getElementsByTagName("script")[0];
        s.parentNode.insertBefore(hm, s);
    })();
</script>
    <meta name="renderer" content="webkit"> <!--该代码指示360浏览器以极速方式浏览-->
    <title>@System.Configuration.ConfigurationManager.AppSettings["AppName"]</title>
    <LINK href="@Url.Content("~/content/images/favicon.ico")" type="image/x-icon" rel=icon>
    <LINK href="@Url.Content("~/content/images/favicon.ico")" type="image/x-icon" rel="shortcut icon">
    <script src="@Url.Content("~/Scripts/jquery-1.6.4.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery.cookie.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery.ua.min.js")" type="text/javascript"></script>
    <link href="@Url.Content("~/Content/login.css")" rel="stylesheet" type="text/css" />
    <script language="javascript" type="text/javascript">
        //防止页面被嵌入。
        if (top.location != self.location) {
            top.location.href = self.location.href;
        }

        $(document).ready(function () {
            var BrowserVersion = navigator.userAgent.toUpperCase();
            $("#imgValiCode").bind("click", function () {
                this.src = '@Url.Content("/Login/GetValidateCode?time=")' + (new Date()).getTime();
            });
            $("#validateCode").keydown(function (even) {
                var curKey = even.which;
                if (curKey == 13) {
                    $("#btnLogin").click();
                }
            });
            if ($.cookie("userName") != null && $.cookie("userName").length > 0)
                $("#userName").val($.cookie("userName"));
            setButton();
            if ($.ua().is360se || $.ua().is360ee) {
                alert("您当前的浏览器为【360该浏览器】，该浏览器可能无法操作本系统的某些功能,请换用IE8或谷歌浏览器访问本系统！");
                return;
            }
            /*判断浏览器版本*/
            if ($.ua().isIe && $.ua().ie != "8") {
                alert("您当前的浏览器为IE" + $.ua().ie + "，该浏览器可能无法操作本系统的某些功能,请换用IE8或谷歌浏览器访问本系统！");
                return;
            }
//            if (BrowserVersion.indexOf("MSIE") >= 0) {
//                if (BrowserVersion.indexOf("MSIE 8.0") < 0) {
//                    alert("您当前的浏览器为" + BrowserVersion.substring(BrowserVersion.indexOf("MSIE"), BrowserVersion.indexOf("MSIE") + 8) + "，该浏览器可能无法操作本系统的某些功能,请换用IE8或谷歌浏览器访问本系统！");
//                    return;
//                }
//            }

        });

        function userLogin() {

            if ($.ua().is360se || $.ua().is360ee) {
                alert("您当前的浏览器为【360该浏览器】，本系统不能使用该浏览器进行操作,请换用IE8或谷歌浏览器访问本系统！");
                return;
            }

            if ($.ua().isIe && $.ua().ie != "8") {
                alert("您当前的浏览器为IE" + $.ua().ie + "，该浏览器可能无法操作本系统的某些功能,请换用IE8或谷歌浏览器访问本系统！");
                return;
            }
            var _userName = $("#userName").val();
            var _password = $("#password").val();
            var _validateCode = $("#validateCode").val();
            var _type = $("#type").val();
            if (_userName.length == 0) {
                alert('用户名不能为空');
                return;
            }
            if (_password.length == 0) {
                alert('密码不能为空');
                return;
            }
            if (_validateCode.length == 0) {
                alert('验证码不能为空');
                return;
            }
            $.post('@Url.Content("~/Login/ValidateUser")', { userName: _userName, password: _password, validateCode: _validateCode, type: _type }, function (msg) {
                if (msg.length > 0) {
                    alert(msg);
                    if (msg == "用户所选择的入口不正确，如果是管理用户，请选择【管理部门登录】入口，如果是龙头企业监测用户，请选择【龙头企业监测】入口！")
                        window.location.reload();
                }
                else {
                    window.location.href = '@Url.Content("~/Home/Index")';
                    // window.open('@Url.Content("~/Home/Index")');
                }
            });
        }

        function loadloginform(type) {
            //type:0为管理用户，1为企业用户
            var width = $("#logindiv").width();
            $("#type").val(type);
            if (type == 0)//为所有输入框加背景色
                $("#logindiv :text,#logindiv :password").css("background-color", "#edfeea");
            else
                $("#logindiv :text,#logindiv :password").css("background-color", "#fffecb");
            // $("#loginbtn").hide();
            //            $("#logindiv").show()

            //                        $("#loginbtn").animate({ left: width, width: '0px', height: '+=0px', opacity: '0.7' }, "500");

            $("#loginbtn").fadeTo(200, 0)
            $("#logindiv").fadeTo(600, 1);
            //自动为输入框设置焦点
            if ($("#userName").val() != null && $.trim($("#userName").val()).length > 0)
                $("#password").focus();
            else
                $("#userName").focus();

        }

        function setButton() {
            $(".login_m").hover(
              function () {
                  $(this).addClass("login_m_hover");
              },
              function () {
                  $(this).removeClass("login_m_hover");
              }
            );

            $(".login_e").hover(
              function () {
                  $(this).addClass("login_e_hover");
              },
              function () {
                  $(this).removeClass("login_e_hover");
              }
            );
        }

    </script>
</head>
<body>
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
            <td class="top1" valign="top">
                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                        <td class="top2">
                            <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                <tr>
                                    <td valign="top" height="214">
                                        <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0"
                                            width="744" height="193">
                                            <param name="movie" value="/Content/top22.swf" />
                                            <param name="wmode" value="transparent" />
                                            <param name="quality" value="high" />
                                            <embed src="/Content/top22.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer"
                                                type="application/x-shockwave-flash" width="744" height="193" wmode="transparent"></embed>
                                        </object>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                            <tr>
                                                <td width="19%" class="top4">
                                                    &nbsp;
                                                </td>
                                                <td width="80%" class="top3">
                                                    &nbsp;
                                                </td>
                                            </tr>
                                        </table>
                                    </td>
                                </tr>
                                <tr>
                                    <td class="center1">
                                        <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                            <tr>
                                                <td class=" center2">
                                                    <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                                        <tr>
                                                            <td width="20%">
                                                                &nbsp;
                                                            </td>
                                                            <td width="1%" height="149" rowspan="3">
                                                                <img src="/Content/images/loginb_19.gif" width="4" height="149" />
                                                            </td>
                                                            <td width="79%">
                                                                &nbsp;
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td align="right">
                                                                <img src="/Content/images/loginb_29.gif" width="86" height="23" />&nbsp;<img src="/Content/images/loginb_31.gif"
                                                                    width="84" height="23" />&nbsp;&nbsp;
                                                            </td>
                                                            <!--在firefox中td的position:relative是无效的
                                                                    要在firefox中使td的position:relative有效，需要同时设置display:block，
                                                                    而IE不用同时设置display:block
                                                             -->
                                                            <td style="position: relative; display: block;">
                                                                <div style="position: absolute; top: 0px; width: 600px;" id="loginbtn">
                                                                    <span class="login_m" onclick="loadloginform(0)"></span><span style="float: left;
                                                                        width: 50px">&nbsp;</span> <span class="login_e" onclick="loadloginform(1)">
                                                                    </span>
                                                                </div>
                                                                <div id="logindiv" style="position: absolute; top: 10px; left: 0px; display: none;">
                                                                    <form id="loginForm" action="#" method="post">
                                                                    <table width="1000px" border="0" cellspacing="0" cellpadding="0">
                                                                        <tr>
                                                                            <td width="60" class="text1">
                                                                                用户名:
                                                                            </td>
                                                                            <td width="70" class="bdys">
                                                                                @* <input id="userName" name="userName" type="text" size="16"  value="@ViewBag.userName"/>*@
                                                                                <input id="userName" name="userName" type="text" size="16" value="@ViewBag.userName"/>
                                                                            </td>
                                                                            <td width="60" class="text1">
                                                                                密 码:
                                                                            </td>
                                                                            <td width="11%" class="bdys">
                                                                                <input id="password" name="password" type="password" size="14" value="" />
                                                                            </td>
                                                                            <td width="60" class="text1">
                                                                                验证码:
                                                                            </td>
                                                                            <td width="6%" class="bdys">
                                                                                <input name="validateCode" id="validateCode" type="text" size="8" maxlength="4" />
                                                                            </td>
                                                                            <td width="7%" align="center">
                                                                                <img id="imgValiCode" style="cursor: pointer;" src="@Url.Content("~/Login/GetValidateCode?time=" + DateTime.Now.Ticks.ToString())" title="点击更换" alt="验证码" />
                                                                            </td>
                                                                            <td width="7%" align="center">
                                                                                <input type="image" onclick="userLogin();return false;" id="btnLogin" value="登陆"
                                                                                    src="/Content/images/loginb_22.gif" width="58" height="24" />
                                                                            </td>
                                                                            <td>
                                                                                &nbsp;
                                                                            </td>
                                                                        </tr>
                                                                    </table>
                                                                    <input type="hidden" id="type" name="type" value="" />
                                                                    </form>
                                                                </div>
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td>
                                                                &nbsp;
                                                            </td>
                                                            <td>
                                                                <div style="color: #ff0000; font-size: 14px;">
                                                                    提示：禁止使用360浏览器、搜狗浏览器登录本系统，否则数据将无法成功保存！</div>
                                                            </td>
                                                        </tr>
                                                    </table>
                                                </td>
                                            </tr>
                                        </table>
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                </table>
                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                        <td class="bottem1">
                            <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                <tr>
                                    <td class="bottem2">
                                        <table width="680" border="0" cellspacing="0" cellpadding="0" style="margin: 0 auto;">
                                            <tr>
                                                <td width="10%">
                                                    &nbsp;
                                                </td>
                                                <td width="88%">
                                                    &nbsp;
                                                </td>
                                            </tr>
                                            <tr>
                                                <td align="right">
                                                    <img src="/Content/images/loginb_43.gif" width="44" height="8" />
                                                </td>
                                                <td class="bottemt" align="left">
                                                    河南省农业厅农业产业化办公室&nbsp;&nbsp;QQ群：114189536&nbsp;&nbsp;电话:0379-64984833&nbsp;&nbsp;<a href="/down/chrome.exe" style="color: #0000ff;">谷歌浏览器</a>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td>
                                                    &nbsp;
                                                </td>
                                                <td>
                                                    &nbsp;
                                                </td>
                                            </tr>
                                        </table>
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
    </table>
   </body>
</html>
